package org.apache.servicecomb.fence.api.resource;

import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping(path = "/v1/user/hair")
public interface UserHairService {
    @PostMapping(path = "/")
    int createUserHair(@RequestBody UserHair userHair);

    @PutMapping(path = "/{id}")
    int updateUserHair(@PathVariable("id") int id, @RequestBody UserHair userHair);

    @DeleteMapping(path = "/{id}")
    int deleteUserHair(@PathVariable("id") int id);

    @GetMapping(path = "/{id}")
    UserHair getUserHair(@PathVariable("id") int id);

    @GetMapping(path = "/")
    List<UserHair> getAllUserHair();

    @GetMapping(path = "/search")
    List<UserHair> searchUserHair(
            @RequestParam(value = "hairColor", required = false) String hairColor,
            @RequestParam(value = "hairType", required = false) String hairType,
            @RequestParam(value = "minHairCount", required = false) Long minHairCount);

    @GetMapping(path = "/user/{userName}")
    UserHair getUserHairByUserName(@PathVariable("userName") String userName);

    @PatchMapping(path = "/{id}/count")
    int updateHairCount(@PathVariable("id") int id, @RequestParam("hairCount") long hairCount);

    @PatchMapping(path = "/{id}/color")
    int updateHairColor(@PathVariable("id") int id, @RequestParam("hairColor") String hairColor);

    @PatchMapping(path = "/{id}/type")
    int updateHairType(@PathVariable("id") int id, @RequestParam("hairType") String hairType);
}